Hi David,
Without changing the KMotionCNC GUI how about this:
Add an M Code at the end of all your programs to run a program in KFLOP to increment a count and to display a message box with the count. ie. "XXX parts completed"
Add a User button to run a program in KFLOP to reset the count to zero.
Regards TK
Group: DynoMotion |
Message: 11808 |
From: David Stevenson |
Date: 6/28/2015 |
Subject: Re: Simple Parts Counter |
Thanks Paul. That sounds reasonable and doable.
Best regards,
David.
On 6/27/2015 2:36 PM,
paul@... [DynoMotion] wrote:
You could create two global integers, desired_part_count
initialized at -1, and current_part_count initialized at
0, when a new gcode file is loaded. When
desired_part_count is -1 nothing happens. If you want to
set a desired part count, use a button or menu item to set
desired_part_count. At the end of each gcode run you can
check desired_part_count. If it's a positive value then
increment current_part_count and compare with
desired_part_count. If it is equal, then do a message box
saying so.
|
|
Group: DynoMotion |
Message: 11809 |
From: Wcarrothers Yahoo |
Date: 6/28/2015 |
Subject: Re: Simple Parts Counter |
I tie these into the circuit that triggers the start sequence from my pendant to count cycles.
So separate from the gui. And also alows you to start the sequence with out a count manually with the gui rather then the pendant button if you need to fix something
eBay item number 331580637701
B
Thanks Paul. That sounds reasonable and doable.
Best regards,
David.
On 6/27/2015 2:36 PM,
paul@... [DynoMotion] wrote:
You could create two global integers, desired_part_count
initialized at -1, and current_part_count initialized at
0, when a new gcode file is loaded. When
desired_part_count is -1 nothing happens. If you want to
set a desired part count, use a button or menu item to set
desired_part_count. At the end of each gcode run you can
check desired_part_count. If it's a positive value then
increment current_part_count and compare with
desired_part_count. If it is equal, then do a message box
saying so.
|
|
Group: DynoMotion |
Message: 11815 |
From: David Stevenson |
Date: 6/28/2015 |
Subject: Re: Simple Parts Counter |
Hi Tom,
Thanks for your suggestion. It seems simple enough that even I could
make it work.
What would be your suggested code to display a message box?
Thanks again,
David.
On 6/27/2015 2:38 PM, Tom Kerekes
tk@... [DynoMotion] wrote:
Hi David,
Without changing the KMotionCNC GUI how about this:
Add an M Code at the end of all your programs to run
a program in KFLOP to increment a count and to display a
message box with the count. ie. "XXX parts completed"
Add a User
button to run a program in KFLOP to reset the count to
zero.
Regards
TK
Group: DynoMotion |
Message: 11816 |
From: David Stevenson |
Date: 6/28/2015 |
Subject: Re: Simple Parts Counter |
Thanks Bill,
That looks like an interesting readout. I'll have to take a good
look at it.
Best regards,
David.
On 6/28/2015 9:24 AM, Wcarrothers Yahoo
wcarrothers@... [DynoMotion] wrote:
I tie these into the circuit that triggers the start
sequence from my pendant to count cycles.
So separate from the gui. And also alows you to start
the sequence with out a count manually with the gui rather
then the pendant button if you need to fix something
eBay item number 331580637701
B
Thanks Paul. That sounds reasonable and doable.
Best regards,
David.
On 6/27/2015 2:36 PM, paul@...
[DynoMotion] wrote:
You could create two global integers,
desired_part_count initialized at -1, and
current_part_count initialized at 0, when a new
gcode file is loaded. When desired_part_count is
-1 nothing happens. If you want to set a
desired part count, use a button or menu item to
set desired_part_count. At the end of each gcode
run you can check desired_part_count. If it's a
positive value then increment current_part_count
and compare with desired_part_count. If it is
equal, then do a message box saying so.
|
|
Group: DynoMotion |
Message: 11817 |
From: Tom Kerekes |
Date: 6/28/2015 |
Subject: Re: Simple Parts Counter |
Hi David,
That would be the MessageBox.c example.
The example shows a fixed message to display "Hello World". To create a string (array of characters) to show the count (ie persist variable 25) you can use the sprintf function to "print" to the string instead of the Console. Something like:
persist.UserData[25]++; // increment the count char MyMessage[80]; // String to be created and displayed sprintf(MyMessage,"Run Count = %d",persist.UserData[25]); // build the message we want to show MsgBox(MyMessage,MB_OK); // Show it
HTH Regards TK
Group: DynoMotion |
Message: 11821 |
From: David Stevenson |
Date: 6/29/2015 |
Subject: Re: Simple Parts Counter |
Hi Tom,
Thank you very much for your help! It is much appreciated.
With best regards,
David.
On 6/28/2015 7:23 PM, Tom Kerekes
tk@... [DynoMotion] wrote:
Hi David,
That would be
the MessageBox.c example.
The
example shows a fixed message to display "Hello World".
To create a string (array of characters) to show the
count (ie persist variable 25) you can use the sprintf
function to "print" to the string instead of the
Console. Something like:
persist.UserData[25]++; // increment the count
char MyMessage[80]; // String to be created and
displayed
sprintf(MyMessage,"Run Count =
%d",persist.UserData[25]); // build the message we want
to show
MsgBox(MyMessage,MB_OK); // Show it
HTH
Regards
TK
| | | | | | | |